//
//  NBusinessServiceViewController.m
//  nncloud
//
//  Created by kabu on 2018/9/15.
//  Copyright © 2018年 youedata. All rights reserved.
#import "NDataInqueryViewController.h"
#import "NQiuzhiInfoDetailVC.h"
#import "NTongjiViewController.h"
#import "NMyQiyeViewController.h"
#import "NBusinessServiceViewController.h"
#import "NServeCell.h"
#import "NMyFeedbackViewController.h"
#import "NCommitFBViewController.h"
#import "NWriteMsgViewController.h"
#import "NProblemContentViewController.h"
#import "NProcessInstrucitonViewController.h"
#import "NIndustryReportFormViewController.h"
#import "NProjectShenbaoViewController.h"
#import "NCaiWuViewController.h"
#import "NInovationCommonViewController.h"
#import "NQiyebanshiViewController.h"
#import "NShenbaoTypeViewController.h"
#import "NMyShenbaoViewController.h"
#import "NNoticeViewController.h"
#import "NRankViewController.h"
#import "NBigDataApplyCommontVC.h"
#import "NQiyeRecruitVC.h"
#import "NQiuzhiMsgViewController.h"
#import "NGovOnlineViewController.h"
#import "NZhichengPingshenVC.h"
#import "NMessageViewController.h"
#import "NRenzhengAndCuibaoVC.h"
#import "NAddGerenQiuZhiViewController.h"

@interface NBusinessServiceViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>

@property(nonatomic,strong)UICollectionView *collectionView;
@property (nonatomic,strong) NSMutableArray *dataArray;

@property (nonatomic,strong) NSArray *titleArray;
@property (nonatomic,strong) NSArray *titleArray1;
@property (nonatomic,strong) NSArray *titleArray2;
@property (nonatomic,strong) NSArray *titleArray3;
@property (nonatomic,strong) NSArray *titleArray4;

@property (nonatomic,strong) NSArray *iconArray;
@property (nonatomic,strong) NSArray *iconArray1;
@property (nonatomic,strong) NSArray *iconArray2;
@property (nonatomic,strong) NSArray *iconArray3;
@property (nonatomic,strong) NSArray *iconArray4;

@property (nonatomic,strong) NSArray *sectionTitleArray;

///0个人   1企业    2政府
@property (nonatomic,assign)NSInteger userType;


@end

#define kLineNumber 4
#define NavHeight 64
#define SectionHeaderHeight 65
NSString *const cellID = @"serveid";
NSString *const headReuseID = @"headReuse";

@implementation NBusinessServiceViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    if ([NUserModel shareInstance].isLogin) {
        if ([[NUserModel shareInstance].badgeCount integerValue]>0) {
            [self.navigationItem.rightBarButtonItem pp_addDotWithColor:[UIColor redColor]];
        }
    }else{
        [self.navigationItem.rightBarButtonItem pp_addDotWithColor:nil];
    }
    
    
    [self data];
    ///因为有一个企业端和个人端的切换共用这个页面  需要刷新这个页面
    [self.collectionView reloadData];
}

- (void)viewDidLoad {
    
    [super viewDidLoad];
    self.view.backgroundColor = kWhiteColor;
    [self.navigationItem setItemWithTitle:@"服务" textColor:kNavigationTitleColor fontSize:18 itemType:center];
    self.navigationItem.leftBarButtonItem = nil;
    
    
    //需要替换成图片后面
        [self addNavgationRightButtonWithFrame:CGRectMake(0, 0, 40, 40) title:@"" Image:@"消息中心" selectedIMG:@"消息中心" tartget:self action:@selector(messageAction)];
    if ([NUserModel shareInstance].isLogin) {
        if ([[NUserModel shareInstance].badgeCount integerValue]>0) {
            
            [self.navigationItem.rightBarButtonItem pp_addDotWithColor:[UIColor redColor]];
        }
    }
    self.userType = 5;//
    [self data];
    [self.view addSubview:self.collectionView];
    
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(scroll) name:@"scroll" object:nil];
    
    // Do any additional setup after loading the view from its nib.
}

-(void)scroll {
    
}

///组装数据
- (void)data {
    
    NSInteger userType = [[[NSUserDefaults standardUserDefaults]objectForKey:kUserType] integerValue];
    self.userType = userType;
    
    if (userType==1) {
        
        self.sectionTitleArray = @[@"营商环境",@"大数据应用",@"工业运行监测",@"创新创业",@"企业服务"];
        
    }else{
        
        self.sectionTitleArray = @[@"营商环境",@"大数据应用",@"创新创业",@"企业服务"];
        
    }
    
    self.titleArray = @[@"公开问题",@"提交反馈",@"我的反馈",@"常见问题"];
    self.iconArray = @[@"问题3",@"未标题-2",@"未标题-3",@"未标题-4"];
    
    self.titleArray1 = @[@"产业地图",@"政府决策指数",@"创新能力应用",@"创新态势",@"企业图谱",];
    self.iconArray1 = @[@"未标题-5",@"未标题-6",@"未标题-8",@"创新态势",@"企业图谱",];
    
    if (userType==1) {
        self.titleArray2 = @[@"我的工业填报",@"我的财务填报",@"我的项目申报",@"我的企业",@"统计分析",@"通知公告",@"积分排名",@"数据查询"];
        self.iconArray2 = @[@"我的工业填报",@"我的财务填报",@"我的项目申报",@"我的企业",@"统计分析",@"通知公告",@"积分排名",@"数据查询"];
    }else{
        //个人端
        self.titleArray2 = @[@"我的工业填报",@"我的财务填报",@"我的项目申报",@"我的企业",@"统计分析",@"通知公告",@"积分排名"];
        self.iconArray2 = @[@"我的工业填报",@"我的财务填报",@"我的项目申报",@"我的企业",@"统计分析",@"通知公告",@"积分排名"];
    }
    
    
    self.titleArray3 = @[@"智慧招商",@"创新创业项目",@"知识产权服务",@"项目申报",@"培训服务",@"融资服务",@"项目路演"];
    self.iconArray3 = @[@"智慧招商",@"创新创业项目",@"知识产权服务",@"项目申报",@"培训服务",@"科技金融",@"项目路演"];
    
    if (userType==1) {
        
        self.titleArray4 = @[@"企业办事",@"企业招聘",@"求职信息",@"政府在线",@"职称评审"];
        self.iconArray4 = @[@"企业办事",@"企业招聘",@"求职信息",@"政府在线",@"职称评审"];
        
    }else{
        self.titleArray4 = @[@"企业招聘",@"个人求职",@"政府在线",@"职称评审"];
        self.iconArray4 = @[@"企业招聘",@"求职信息",@"政府在线",@"职称评审"];
    }
    
}

///消息中心
- (void)messageAction {
    YYLog(@"跳往消息中心");
    NMessageViewController *msg = [NMessageViewController new];
    msg.userType = [NSString stringWithFormat:@"%ld",self.userType];
    msg.hidesBottomBarWhenPushed = YES;
    [self.navigationController pushViewController:msg animated:YES];
    
}
//流式布局
- (UICollectionViewFlowLayout *)flowLayout {
    UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
    layout.sectionInset = UIEdgeInsetsMake(15, 0, 5, 0);
    layout.minimumLineSpacing = 0.f;
    layout.minimumInteritemSpacing = 0.f;
    //    layout.headerReferenceSize = CGSizeMake(kScreenWidth, SectionHeaderHeight);
    return layout;
}
- (UICollectionView *)collectionView {
    if (!_collectionView) {
        _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight-NavHeight-50) collectionViewLayout:[self flowLayout]];
        _collectionView.delegate = self;
        _collectionView.dataSource = self;
        _collectionView.showsVerticalScrollIndicator = NO;
        [self registerCell];
        //        WeakStament(ws);
        //        _collectionView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
        //            [ws refreshData];
        //        }];
        _collectionView.backgroundColor = kWhiteColor;
    }
    return _collectionView;
}

- (void)registerCell {
    
    [_collectionView registerNib:[UINib nibWithNibName:NSStringFromClass([NServeCell class]) bundle:nil] forCellWithReuseIdentifier:cellID];
    [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:headReuseID];
    
}

#pragma  mark - datasource
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{
    
    if (self.userType==1) {
        
        return 5;
        
    }else{
        
        return 4;
    }
    
    
}
-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    
    if (self.userType==1) {
        
        
        switch (section) {
            case 0:
            {
                return 4;
            }
                break;
            case 1:
            {
                return 5;
            }
                break;
            case 2:
            {
                return self.titleArray2.count;
            }
                break;
            case 3:{
                return 7;
            }
                break;
            case 4:
            {
                return 5;
            }
                break;
                
            default:
                break;
        }
    }else{
        
        //个人
        switch (section) {
                
            case 0:
            {
                return 4;
            }
                break;
            case 1:
            {
                return 5;
            }
                break;
            case 2:
            {
                return self.titleArray2.count;
            }
                break;
            case 3:
            {
                return 4;
            }
                break;
                
            default:
                break;
        }
    }
    
    return 0;
}

///cell
-(__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    if (self.userType==1) {
        //企业端
        NServeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
        if (indexPath.section==0) {
            
            cell.nameLabel.text = self.titleArray[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray[indexPath.row]);
            
        }else if(indexPath.section==1){
            
            cell.nameLabel.text = self.titleArray1[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray1[indexPath.row]);
            
        }else if (indexPath.section==2){
            
            cell.nameLabel.text = self.titleArray2[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray2[indexPath.row]);
            
        }else if (indexPath.section==3){
            cell.nameLabel.text = self.titleArray3[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray3[indexPath.row]);
        }else{
            cell.nameLabel.text = self.titleArray4[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray4[indexPath.row]);
        }
        return cell;
        
        
    }else{
        
        //个人端
        NServeCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:cellID forIndexPath:indexPath];
        if (indexPath.section==0) {
            cell.nameLabel.text = self.titleArray[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray[indexPath.row]);
        }else if(indexPath.section==1){
            cell.nameLabel.text = self.titleArray1[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray1[indexPath.row]);
        }else if (indexPath.section==2){
            cell.nameLabel.text = self.titleArray3[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray2[indexPath.row]);
        }else if (indexPath.section==3){
            cell.nameLabel.text = self.titleArray4[indexPath.row];
            cell.iconImage.image = WDImgName(self.iconArray4[indexPath.row]);
        }
        return cell;
    }
    return nil;
}

-(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
    
    UICollectionReusableView *reusabelView = nil;
    //    XALifeListModel *model = self.dataArray[indexPath.section-BannerIndex];
    if (kind == UICollectionElementKindSectionHeader) {
        UIView *bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, SectionHeaderHeight)];
        bgView.backgroundColor = [UIColor clearColor];
        UIView *sepratorView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, ScreenWidth, 11)];
        sepratorView.backgroundColor = NColorFrom16RGB(0xeeeeee);
        UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, ScreenWidth, SectionHeaderHeight-5)];
        //        titleLabel.text = model.title;
        
        titleLabel.text = self.sectionTitleArray[indexPath.section];
        
        UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:headReuseID forIndexPath:indexPath];
        [headerView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
        
        [headerView addSubview:bgView];
        [headerView addSubview:sepratorView];
        [headerView addSubview:titleLabel];
        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, SectionHeaderHeight-6, ScreenWidth, 1)];
        line.backgroundColor = NColorFrom16RGB(0xeeeeee);
        [headerView addSubview:line];
        reusabelView = headerView;
    }
    return reusabelView;
}

#pragma mark - delegate
//cell尺寸
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    CGFloat width=ScreenWidth/kLineNumber;
    return CGSizeMake(width, width);
}

///section header 尺寸
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
    return CGSizeMake(ScreenWidth, SectionHeaderHeight-20);
}


-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
    
    YYLog(@"%@",indexPath);
    
    if (indexPath.section==0) {
        
        switch (indexPath.row) {
            case 0:
            {
                YYLog(@"%@",indexPath);
                NMyFeedbackViewController *myFb = [NMyFeedbackViewController new];
                myFb.hidesBottomBarWhenPushed = YES;
                myFb.flag = @"open";
                [self.navigationController pushViewController:myFb animated:YES];
            }
                break;
                
            case 1:
            {
                
                //编写留言
                YYLog(@"%@",indexPath);
                if ([NUserModel shareInstance].isLogin) {
                    if ([[NUserModel shareInstance].userInfoCertificationStatus integerValue]==1) {
                        NCommitFBViewController *comm = [NCommitFBViewController new];
                        comm.hidesBottomBarWhenPushed = YES;
                        [self.navigationController pushViewController:comm animated:YES];
                    }else{
                        [AFToast showText:@"认证通过后可提交反馈"];
                    }
                   
                }else{
                    [self callLoginVC];
                }
                
                
            }
                break;
            case 2:
            {
                YYLog(@"%@",indexPath);
                if ([NUserModel shareInstance].isLogin) {
                    NMyFeedbackViewController *myFb = [NMyFeedbackViewController new];
                    myFb.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:myFb animated:YES];
                }else{
                    [self callLoginVC];
                }
                
            }
                break;
            case 3:
            {
                //常见问题
                NProcessInstrucitonViewController *proc = [NProcessInstrucitonViewController new];
                proc.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:proc animated:YES];
            }
                break;
                
            default:
                break;
        }
        
    }else if (indexPath.section==1){
        
        NBigDataApplyCommontVC *data = [NBigDataApplyCommontVC new];
        data.hidesBottomBarWhenPushed = YES;
        
        
        ///大数据应用
        switch (indexPath.row) {
            case 0:
            {
                data.url = @"http://211.149.207.217/Nanning_DP/#/";
                
            }
                break;
            case 1:
            {
                
                data.url = @"http://cdyoue.com.cn:18182/visualization/bigData/html/investmentSituatioin.html";
                
            }
                break;
                
            case 2:
            {
                
                data.url = @"http://cdyoue.com.cn:18182/cxnl/";
                
            }
                break;
                
            case 3:
            {
                ///创新态势
                data.url = @"http://cdyoue.com.cn:18182/cxst/index.html";
            }
                
                break;
                
            case 4:
            {
                //企业图谱
                data.url = @"http://cdyoue.com.cn:18182/visualization/bigData/html/enterpriseAtlas.html";
                
            }
                break;
                
            default:
                break;
                
        }
        
         [self.navigationController pushViewController:data animated:YES];
        
    }else if (indexPath.section==2){
        
        
        if (self.userType==1) {
            
            ///企业端工业运行相关数据需要登录才能查看
            if (![NUserModel shareInstance].isLogin) {
                
                [self callLoginVC];
                return;
            }
            
            switch (indexPath.row) {
                case 0:
                {
                    if ([NUserModel shareInstance].isLogin) {
                        NIndustryReportFormViewController *data = [NIndustryReportFormViewController new];
                        data.userType = [NSString stringWithFormat:@"%ld",self.userType];
                        data.hidesBottomBarWhenPushed = YES;
                        [self.navigationController pushViewController:data animated:YES];
                    }else{
                        [self callLoginVC];
                    }
                    
                }
                    
                    break;
                case 1:
                {
                     if ([NUserModel shareInstance].isLogin) {
                         NCaiWuViewController *caiwu = [NCaiWuViewController new];
                         caiwu.userType = [NSString stringWithFormat:@"%ld",self.userType];
                         caiwu.hidesBottomBarWhenPushed = YES;
                         [self.navigationController pushViewController:caiwu animated:YES];
                     }else{
                         [self callLoginVC];
                     }
                    
                }
                    break;
                case 2:
                {
                    NProjectShenbaoViewController *shenbao = [NProjectShenbaoViewController new];
                    shenbao.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:shenbao animated:YES];
                }
                    break;
                case 3:
                {
                    NMyQiyeViewController *qiye = [NMyQiyeViewController new];
                    qiye.userType = [NSString stringWithFormat:@"%ld",self.userType];
                    qiye.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:qiye animated:YES];
                }
                    break;
                case 4:
                {
                    //统计分析
                    NTongjiViewController *tongji = [NTongjiViewController new];
                    tongji.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:tongji animated:YES];
                    
                }
                    break;
                case 5:
                {
                    //通知公告
                    NRenzhengAndCuibaoVC *cuibao = [NRenzhengAndCuibaoVC new];
                    cuibao.atitle = @"通知公告";
                    cuibao.msgType = @"2";
                    cuibao.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:cuibao animated:YES];
                }
                    break;
                case 6:
                {
                    //积分排名
                    NRankViewController *rank = [NRankViewController new];
                    rank.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:rank animated:YES];
                }
                    break;
                    
                case 7:
                {
                    //数据查询
                    NDataInqueryViewController *inquery = [NDataInqueryViewController new];
                    inquery.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:inquery animated:YES];
                }
                    break;
                    
                    
                    
                default:
                    break;
            }
        }else{
            ///个人端
            NInovationCommonViewController *common = [NInovationCommonViewController new];
            
            switch (indexPath.row) {
                    
                case 0:
                {
                    common.atitle = @"智慧招商";
                }
                    break;
                case 1:
                {
                    common.atitle = @"创新创业";
                }
                    break;
                case 2:
                {
                    common.atitle = @"知识产权";
                }
                    
                    break;
                case 3:
                {
                    common.atitle = @"项目申报";
                }
                    break;
                case 4:
                {
                    common.atitle = @"培训服务";
                }
                    break;
                case 5:
                {
                    common.atitle = @"融资服务";
                }
                    break;
                case 6:
                {
                    common.atitle = @"项目路演";
                }
                    break;
                default:
                    break;
            }
            common.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:common animated:YES];
        }
    }else if (indexPath.section==3){
        
        if (self.userType==1) {
            
            NInovationCommonViewController *common = [NInovationCommonViewController new];
            switch (indexPath.row) {
                    
                case 0:
                {
                    common.atitle = @"智慧招商";
                }
                    break;
                case 1:
                {
                    common.atitle = @"创新创业";
                }
                    break;
                case 2:
                {
                    common.atitle = @"知识产权";
                }
                    
                    break;
                case 3:
                {
                    common.atitle = @"项目申报";
                }
                    break;
                case 4:
                {
                    common.atitle = @"培训服务";
                }
                    break;
                case 5:
                {
                    common.atitle = @"融资服务";
                }
                    break;
                case 6:
                {
                    common.atitle = @"项目路演";
                }
                    break;
                default:
                    break;
            }
            common.hidesBottomBarWhenPushed = YES;
            [self.navigationController pushViewController:common animated:YES];
            
        }else{
            
            //个人端
            switch (indexPath.row) {
                
                case 0:
                {
                    NQiyeRecruitVC *recruit = [NQiyeRecruitVC new];
                    recruit.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:recruit animated:YES];
                }
                    break;
                case 1:
                {
                    if ([NUserModel shareInstance].isLogin) {
                        
                    //先请求一下看是否已经添加了该求职者信息
                        [self addJobSeeker];
//                    NAddGerenQiuZhiViewController *msg = [NAddGerenQiuZhiViewController new];
//                    msg.hidesBottomBarWhenPushed = YES;
//                    [self.navigationController pushViewController:msg animated:YES];
                    }else{
                        [self callLoginVC];
                    }
                }
                    break;
                case 2:
                {
                    NGovOnlineViewController *gov = [NGovOnlineViewController new];
                    gov.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:gov animated:YES];
                }
                    break;
                case 3:
                {
                    NZhichengPingshenVC *zhicheng = [NZhichengPingshenVC new];
                    zhicheng.hidesBottomBarWhenPushed = YES;
                    [self.navigationController pushViewController:zhicheng animated:YES];
                }
                    break;
                default:
                    break;
            }
        }
    }else{
        
        //企业服务
        switch (indexPath.row) {
            case 0:
            {
                NQiyebanshiViewController *banshi = [NQiyebanshiViewController new];
                banshi.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:banshi animated:YES];
            }
                break;
            case 1:
            {
                NQiyeRecruitVC *recruit = [NQiyeRecruitVC new];
                recruit.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:recruit animated:YES];
            }
                break;
            case 2:
            {
                NQiuzhiMsgViewController *msg = [NQiuzhiMsgViewController new];
                msg.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:msg animated:YES];
            }
                break;
            case 3:
            {
                NGovOnlineViewController *gov = [NGovOnlineViewController new];
                gov.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:gov animated:YES];
            }
                break;
            case 4:
            {
                NZhichengPingshenVC *zhicheng = [NZhichengPingshenVC new];
                zhicheng.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:zhicheng animated:YES];
            }
                break;
                
            default:
                break;
        }
    }
}


//添加个人求职有问题
///添加求职者信息 相当于先注册，后台存在了，然后再更新信息  查询看是否已添加过这个人的信息
-(void)addJobSeeker{
    

    ///没有添加过进行个人信息的添加
//    NAddGerenQiuZhiViewController *msg = [NAddGerenQiuZhiViewController new];
//    msg.hidesBottomBarWhenPushed = YES;
//    [self.navigationController pushViewController:msg animated:YES];
    
    NSDictionary *dic = @{@"resumeUserId":[NUserModel shareInstance].userInfoId,};
    [[NNRCNetRequest manager]postWithUrl:kResumeAddUrl params:dic success:^(id result) {
        YYLog(@"%@",result);

        if ([result[@"code"] isEqualToString:@"0"]) {

            if ([result[@"page"] isEqualToString:@"false"]) {

                ///如果是进来就出去，用户并没有信息的录入，但是已经添加过了，业务逻辑需要产品定夺
                ///表示已经添加过个人求职信息
                NQiuzhiInfoDetailVC *detail = [NQiuzhiInfoDetailVC new];
                //            if (model.resumeUserId) {
                ////                detail.qiuzhiId = model.resumeUserId;
                //            }
                //这里应该传的是一个用户id
                detail.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:detail animated:YES];


            }else{

                NAddGerenQiuZhiViewController *msg = [NAddGerenQiuZhiViewController new];
                msg.hidesBottomBarWhenPushed = YES;
                [self.navigationController pushViewController:msg animated:YES];
            }

        }else{


        }
    } failure:^(id failure) {

    }];
    
}


@end
